#ifndef __APIDEMO_H__ 
#define __APIDEMO_H__

#include "api.pb.h"

class JzAGVApi
{
public:
    JzAGVApi(std::string host, short port);
    ~JzAGVApi();
public:
    int Connect();
public:
    void GetRobots(std::vector<unsigned int> &ids);
    int CreateMission(std::string uuid);
    void GetMission(int missionID);
    void GetMissionByUUID(std::string uuid);
    int CancelMission(std::string uuid);
    void CheckIfCanceled(int cmdID);
public:
    api::Response* SendMessage(api::Request &req);
private:
    int Send(const std::string &s);
    int Recv(std::string &s);
private:
    std::string m_Host;
    short m_Port;
    int m_Sock;
};

#endif
